package com.lktx.sso.admin.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class ProtocolEndpointVO {
    //基础地址
    private String issuer="基础地址";
    //发现端点
    private String discoveryEndpoint="发现端点";
    //用户信息端点
    private String userinfoEndpoint="用户信息端点";
    //验签公钥端点
    private String jwksEndpoint="验签公钥端点";
    //令牌吊销端点
    private String revokeEndpoint="令牌吊销端点";
    //令牌端点
    private String tokenEndpoint="令牌端点";
    //授权端点
    private String authorizationEndpoint="授权端点";
    //结束会话端点
    private String endSessionEndpoint="结束会话端点";

    public ProtocolEndpointVO(String baseIss,Integer appId){
        this.issuer= String.format("%s/%s", baseIss, appId);
        this.discoveryEndpoint= String.format("%s/%s/.well-known/openid-configuration", baseIss, appId);
        this.userinfoEndpoint =String.format("%s/%s/oauth2/userinfo", baseIss, appId);
        this.jwksEndpoint= String.format("%s/%s/.well-known/jwks.json", baseIss, appId);
        this.revokeEndpoint= String.format("%s/%s/oauth2/revoke", baseIss, appId);
        this.tokenEndpoint=String.format("%s/%s/oauth2/token", baseIss, appId);
        this.authorizationEndpoint= String.format("%s/%s/oauth2/authorize", baseIss, appId);
    }
}